package xyz.eden.cloud.common.core.system;

public class RuntimeUtils {

    public static final Runtime CURRENT_RUNTIME = Runtime.getRuntime();

    /**
     * 获取当前运行环境
     *
     * @return
     */
    public static Runtime getCurrentRuntime() {
        return CURRENT_RUNTIME;
    }

    /**
     * 获取当前可用内存
     *
     * @return
     */
    public static long freeMemory() {
        return CURRENT_RUNTIME.freeMemory();
    }

    /**
     * 获取总内存
     * 单位字节
     *
     * @return
     */
    public static long totalMemory() {
        return CURRENT_RUNTIME.totalMemory();
    }
}
